package com.aspose.cells;

import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;

public class zan extends com.aspose.cells.a.d.zd {
   static ArrayList a = new ArrayList();
   Worksheet b;
   Workbook c;
   zasn d;
   int e;
   int f;
   private zatl C;
   private float D;
   private float E;
   private double F;
   double g;
   double h;
   double i;
   double j;
   private Style G;
   private double[] H;
   private zafj I;
   private ArrayList J;
   public int k;
   public int l;
   public int m;
   public int n;
   private WorksheetCollection K;
   private ArrayList L;
   private HashMap M;
   private float N;
   private com.aspose.cells.b.a.b.zt O;
   private int P;
   private Cells Q;
   HashMap o;
   HashMap p;
   HashMap q;
   HashMap r;
   HashMap s;
   private int R;
   int t;
   int u;
   int v;
   int w;
   private int S;
   private int T;
   double[] x;
   private ArrayList U;
   private zfu V;
   Font y;
   ImageOrPrintOptions z;
   com.aspose.cells.a.d.ze A;
   private zxu W;
   private zhc X;
   private zhf Y;
   private zaay Z;
   public int B;
   private zbuz aa;
   private HashMap ab;
   private zfw ac;
   private zbmg ad;

   zan(Worksheet var1, zasn var2, int var3, int var4, ArrayList var5, ImageOrPrintOptions var6, zbuz var7, zaay var8, zxu var9) {
      this(var1, var2, var3, var4, var5, var6, var7, Integer.MAX_VALUE, var8, var9);
   }

   zan(Worksheet var1, zasn var2, int var3, int var4, ArrayList var5, ImageOrPrintOptions var6, zbuz var7, int var8, zaay var9, zxu var10) {
      this.H = new double[2];
      this.k = -1;
      this.m = -1;
      this.L = new ArrayList();
      this.O = new com.aspose.cells.b.a.b.zt(0.0F, 0.0F);
      this.x = new double[2];
      this.z = null;
      this.A = null;
      this.B = Integer.MAX_VALUE;
      this.ac = new zfw();
      this.B = var8;
      this.b = var1;
      this.R = var1.m();
      this.ad = (zbmg)var7.h.get(this.R);
      this.ab = var7.f[this.R];
      this.d = var2;
      this.V = this.d.c;
      this.e = var3;
      this.f = var4;
      this.c = var1.getWorkbook();
      this.K = this.c.getWorksheets();
      this.Q = this.b.getCells();
      this.Z = var9;
      this.W = var10;
      this.X = (zhc)var10.a();
      this.H = new double[]{1.0D, 1.0D};
      this.N = (float)this.c.getWorksheets().L();
      this.G = this.c.getWorksheets().D();
      Font var11 = this.G.getFont();
      this.Y = new zhf(var11.getName(), var11.getSize(), var11.m(), true);
      this.M = new HashMap();
      this.O = new com.aspose.cells.b.a.b.zt(0.0F, 0.0F);
      this.S = this.d.d;
      this.T = this.d.e;
      this.v = this.d.f;
      this.w = this.d.g;
      this.P = -(this.c.getWorksheets().J() + this.c.getWorksheets().I() + 2);
      this.C = new zatl(var7);
      this.aa = var7;
      this.U = var5;
      this.L = this.ad.j;
      this.z = var6;
      this.g = this.d.h;
      this.h = this.d.i;
      this.x[0] = this.g * 72.0D;
      this.x[1] = this.h * 72.0D;
      this.i = var2.j;
      this.j = var2.k;
      this.J = this.d.l;
      this.y = new Font((WorksheetCollection)null, (Object)null, false);
      if (this.c.getSaveOptions().e != null && this.c.getSaveOptions().e.length() > 0) {
         this.y.setName(this.c.getSaveOptions().e);
      } else {
         this.y.setName(com.aspose.cells.a.d.zbw.a);
      }

      this.c.getSaveOptions().e = this.y.getName();
   }

   private static void a(com.aspose.cells.a.d.zm var0, Workbook var1) throws Exception {
      if (zsu.a(var1.getWorksheets())) {
         com.aspose.cells.a.d.zf var2 = new com.aspose.cells.a.d.zf(new com.aspose.cells.a.d.zav("Arial", 10.0F, 0), Color.getRed(), new com.aspose.cells.b.a.b.zo(10.0F, 10.0F), "Evaluation Only. Created with " + zakq.b() + ". Copyright 2003 - " + DateTime.getNow().getYear() + " Aspose Pty Ltd.");
         var0.a(var2);
      }
   }

   private static void a(com.aspose.cells.a.d.ze var0, com.aspose.cells.a.d.zb var1) {
      com.aspose.cells.a.d.zam var2 = var0.b;

      for(int var3 = 0; var3 < var0.a.size(); ++var3) {
         if (var0.a.get(var3) != null) {
            com.aspose.cells.a.d.zb var4 = (com.aspose.cells.a.d.zb)var0.a.get(var3);
            if (var4 != null && var4.e().c(var2)) {
               var1.a((com.aspose.cells.a.d.zl)var4);
            }
         }
      }

   }

   private com.aspose.cells.a.d.zb a(float var1, float var2, float[] var3) throws Exception {
      int var4;
      for(var4 = this.d.c.b; var4 <= this.d.c.d; ++var4) {
         com.aspose.cells.b.a.a.ze.a(this.A.c, (Object)var4);
      }

      for(var4 = this.d.c.a; var4 <= this.d.c.c; ++var4) {
         com.aspose.cells.b.a.a.ze.a(this.A.d, (Object)var4);
      }

      com.aspose.cells.a.d.zb var18 = new com.aspose.cells.a.d.zb();
      com.aspose.cells.b.a.b.zt var9 = zatm.a(this.d.c.c, this.c.getWorksheets().G(), this.H);
      float var7 = var9.b();
      float var8 = var9.c();
      var3[0] = var7;
      var3[1] = var8;
      com.aspose.cells.a.d.zn var10 = com.aspose.cells.a.d.zn.b(new com.aspose.cells.b.a.b.zq(0.0F, 0.0F, var7, var8));
      var10.a = new com.aspose.cells.a.d.zs(Color.getBlack(), 1.0F);
      var18.a((com.aspose.cells.a.d.zl)var10);
      float var5 = var7;
      com.aspose.cells.a.d.zav var11 = new com.aspose.cells.a.d.zav(this.c.getWorksheets().G().getName(), (float)Math.max(this.c.getWorksheets().G().getDoubleSize() * this.H[1], 2.0D), this.c.getWorksheets().G().m());

      int var12;
      int var13;
      String var14;
      float var15;
      for(var12 = 0; var12 < this.A.c.size(); ++var12) {
         var13 = (Integer)((Integer)this.A.c.get(var12));
         var14 = CellsHelper.columnIndexToName(var13);
         var7 = (float)(this.Q.c.b(var13) * 72.0D * this.H[0]);
         if (var7 > 0.001F) {
            var10 = com.aspose.cells.a.d.zn.b(new com.aspose.cells.b.a.b.zq(var5, 0.0F, var7, var8));
            var10.a = new com.aspose.cells.a.d.zs(Color.getBlack(), 1.0F);
            var18.a((com.aspose.cells.a.d.zl)var10);
            var15 = (float)zatm.a(var14, this.c.getWorksheets().G(), this.H[1], 0);
            com.aspose.cells.a.d.zf var16 = new com.aspose.cells.a.d.zf(var11, Color.getBlack(), new com.aspose.cells.b.a.b.zo(var5 + (var7 - var15) / 2.0F, (float)((double)var8 - (double)var11.i() * this.H[1])), var14);
            var18.a((com.aspose.cells.a.d.zl)var16);
            var5 += var7;
         }
      }

      var7 = var9.b();
      float var6 = var8;

      for(var12 = 0; var12 < this.A.d.size(); ++var12) {
         var13 = (Integer)((Integer)this.A.d.get(var12));
         var14 = com.aspose.cells.b.a.zo.a(var13 + 1);
         var15 = (float)(this.Q.getRowHeightInch(var13) * 72.0D * this.H[1]);
         if (var15 > 0.001F) {
            var10 = com.aspose.cells.a.d.zn.b(new com.aspose.cells.b.a.b.zq(0.0F, var6, var7, var15));
            var10.a = new com.aspose.cells.a.d.zs(Color.getBlack(), 1.0F);
            var18.a((com.aspose.cells.a.d.zl)var10);
            float var19 = (float)zatm.a(var14, this.c.getWorksheets().G(), this.H[1], 0);
            com.aspose.cells.a.d.zf var17 = new com.aspose.cells.a.d.zf(var11, Color.getBlack(), new com.aspose.cells.b.a.b.zo((var7 - var19) / 2.0F, (float)((double)(var6 + var15) - (double)var11.i() * this.H[1])), var14);
            var18.a((com.aspose.cells.a.d.zl)var17);
            var6 += var15;
         }
      }

      var18.a(new com.aspose.cells.b.a.b.a.zi(1.0F, 0.0F, 0.0F, 1.0F, var1, var2));
      return var18;
   }

   public void a(com.aspose.cells.a.d.ze var1) throws Exception {
      this.A = var1;
      if (this.d.r != null) {
         this.f();
      } else {
         com.aspose.cells.a.d.zm var2 = new com.aspose.cells.a.d.zm((float)this.x[0], (float)this.x[1]);
         var1.c.clear();
         var1.d.clear();
         this.m = this.ad.h;
         this.n = this.ad.i;

         int var3;
         for(var3 = this.m; var3 <= this.n; ++var3) {
            if (var3 >= 0) {
               if (this.b.getCells().getColumnWidth(var3) != 0.0D) {
                  break;
               }

               this.m = var3 + 1;
            }
         }

         this.k = this.ad.f;
         this.l = this.ad.g;

         for(var3 = this.k; var3 <= this.l; ++var3) {
            if (var3 >= 0) {
               if (this.b.getCells().getRowHeight(var3) != 0.0D) {
                  break;
               }

               this.k = var3 + 1;
            }
         }

         com.aspose.cells.b.a.b.zq var14 = new com.aspose.cells.b.a.b.zq();
         com.aspose.cells.b.a.b.zq var4 = new com.aspose.cells.b.a.b.zq();
         this.H = this.ad.c;
         if (!this.z.getOnlyArea()) {
            var2.a(this.d());
         }

         com.aspose.cells.b.a.b.zq[] var5 = new com.aspose.cells.b.a.b.zq[]{var14};
         com.aspose.cells.a.d.zb var6 = this.a(var5);
         var14 = var5[0];
         com.aspose.cells.b.a.b.zq var7 = new com.aspose.cells.b.a.b.zq();
         var7.a(var14.f() - 0.5F);
         var7.b(var14.g() - 0.5F);
         var7.c(var14.h() + 1.0F);
         var7.d(var14.i() + 1.0F);
         var6.a(new com.aspose.cells.a.d.zn(var7));
         var2.a(var6);
         com.aspose.cells.b.a.b.zq[] var8 = new com.aspose.cells.b.a.b.zq[]{var4};
         com.aspose.cells.a.d.zb var9 = this.b(var8);
         var4 = var8[0];
         var7.a(var4.f() - 0.5F);
         var7.b(var4.g() - 0.5F);
         var7.c(var4.h() + 2.0F);
         var7.d(var4.i() + 2.0F);
         var9.a(new com.aspose.cells.a.d.zn(var7));
         var2.a(var9);
         float[] var10 = new float[]{0.0F, 0.0F};
         com.aspose.cells.a.d.zb var11 = null;
         if (this.b.getPageSetup().getPrintHeadings()) {
            var11 = this.a((float)this.d.n * 72.0F / 2.54F, (float)this.d.o * 72.0F / 2.54F, var10);
         }

         if (var6.g().size() > 0) {
            var6.a(new com.aspose.cells.b.a.b.a.zi());
            var6.a().b((float)this.d.n * 72.0F / 2.54F + var10[0], (float)this.d.o * 72.0F / 2.54F + var10[1]);
         }

         if (var9.g().size() > 0) {
            var9.a(new com.aspose.cells.b.a.b.a.zi());
            var9.a().b((float)this.d.n * 72.0F / 2.54F + var14.h() + var10[0], (float)this.d.o * 72.0F / 2.54F + var10[1]);
         }

         Iterator var12 = super.g().iterator();

         while(var12.hasNext()) {
            com.aspose.cells.a.d.zd var13 = (com.aspose.cells.a.d.zd)var12.next();
            var13.a((com.aspose.cells.a.d.zd)var2);
            var2.a(var13);
         }

         var1.b = this.e();
         if (this.z != null && this.z.getDrawObjectEventHandler() != null) {
            this.z.getDrawObjectEventHandler().a(this.e, this.f, this.R);
            this.z.getDrawObjectEventHandler().a(-this.d.m.f() + (float)this.d.n * 72.0F / 2.54F + var14.h() + var10[0], -this.d.m.g() + (float)this.d.o * 72.0F / 2.54F + var4.i() + var10[1]);
         }

         com.aspose.cells.a.d.zb var15 = this.c();
         a(this.A, var15);
         var15.a(new com.aspose.cells.a.d.zn(new com.aspose.cells.b.a.b.zq(this.d.m.f() - 0.5F, this.d.m.g() - 0.5F, (float)Math.ceil(Math.min((double)this.d.m.h(), this.d.j)) + 1.0F, (float)Math.ceil((double)(this.d.m.i() + 1.0F)))));
         var15.a(new com.aspose.cells.b.a.b.a.zi());
         var2.a(var15);
         if (this.b.getDisplayRightToLeft()) {
            var15.a().b(-this.d.m.l() - (float)this.d.p * 72.0F / 2.54F + (float)this.g * 72.0F + var14.h() + var10[0], -this.d.m.g() + (float)this.d.o * 72.0F / 2.54F + var4.i() + var10[1]);
         } else {
            var15.a().b(-this.d.m.f() + (float)this.d.n * 72.0F / 2.54F + var14.h() + var10[0], -this.d.m.g() + (float)this.d.o * 72.0F / 2.54F + var4.i() + var10[1]);
         }

         if (var11 != null) {
            var11.a(new com.aspose.cells.a.d.zn(new com.aspose.cells.b.a.b.zq(-0.5F, -0.5F, var14.h() + var10[0] + (float)Math.ceil(Math.min((double)this.d.m.h(), this.d.j)) + 1.0F, var4.i() + (float)Math.ceil((double)(this.d.m.i() + 1.0F)) + var10[1])));
            com.aspose.cells.a.d.zn var16 = com.aspose.cells.a.d.zn.b(new com.aspose.cells.b.a.b.zq(0.0F, 0.0F, var14.h() + var10[0] + (float)Math.ceil(Math.min((double)this.d.m.h(), this.d.j)), var4.i() + (float)Math.ceil((double)this.d.m.i()) + var10[1]));
            var16.a = new com.aspose.cells.a.d.zs(Color.getBlack());
            var11.a((com.aspose.cells.a.d.zl)var16);
            var2.a(var11);
         }

         a(var2, this.c);
         var2.a(this.A);
         var11 = null;
         var15.a((com.aspose.cells.a.d.zn)null);
         var15.a((com.aspose.cells.a.d.zd)null);
         var12 = null;
         var2 = null;
         this.I = null;
         this.M = new HashMap();
         this.C = new zatl(this.aa);
      }
   }

   private void f() throws Exception {
      com.aspose.cells.a.d.zm var1 = new com.aspose.cells.a.d.zm((float)this.x[0], (float)this.x[1]);
      var1.a(this.d());
      com.aspose.cells.a.d.zb var2 = this.d.r;
      var2.a(new com.aspose.cells.b.a.b.a.zi());
      var1.a(var2);
      if (this.b.getDisplayRightToLeft()) {
         var2.a().b(-((float)this.d.p) * 72.0F / 2.54F + (float)this.g * 72.0F, (float)this.d.o * 72.0F / 2.54F);
      } else {
         var2.a().b((float)this.d.n * 72.0F / 2.54F, (float)this.d.o * 72.0F / 2.54F);
      }

      a(var1, this.c);
      var1.a(this.A);
      var2.a((com.aspose.cells.a.d.zn)null);
      var2.a((com.aspose.cells.a.d.zd)null);
      var2 = null;
      var1 = null;
      this.I = null;
      this.M = new HashMap();
      this.C = new zatl(this.aa);
   }

   private void a(zfu var1, float var2, float var3) throws Exception {
      this.E = var2;
      this.D = var3;
      this.C.a = new com.aspose.cells.a.d.zb();
      this.a(var1);
   }

   private void a(zfu var1) throws Exception {
      int var2 = var1.a;
      int var3 = var1.c;
      int var4 = var1.b;
      int var5 = var1.d;
      this.F = 0.0D;
      this.C.c = var2;
      this.C.d = var4;
      this.C.e = var3;
      this.C.f = var5;
      this.C.y = this.b.getCells();
      this.C.d();
      this.C.c();
      this.C.e();
      this.C.i();
      this.C.L = false;
      this.C.j = this.D;
      this.C.i = this.E;
      this.C.F = this.H;
      if (this.Q.i().getPrintGridlines()) {
         this.C.a(this.E, this.D, this.d.m, this.Q.c);
      }

      for(int var6 = var2; var6 <= var3; ++var6) {
         float var7 = (float)this.H[1] * (float)this.Q.getRowHeight(var6);
         this.a(var6, var2, var4, var3, var5);
         this.C.j += var7;
      }

      this.a(var1, false);
      this.C.f();
      this.C.a(this.E, this.D);
      this.C.g();
      this.C.j();
   }

   private zfu a(zfu var1, boolean var2) throws Exception {
      double var3 = 0.0D;
      double var5 = 0.0D;
      if (this.L != null) {
         Iterator var7 = this.L.iterator();

         label145:
         while(true) {
            zbgq var8;
            do {
               do {
                  do {
                     if (!var7.hasNext()) {
                        break label145;
                     }

                     var8 = (zbgq)var7.next();
                  } while(var8.j().getMsoDrawingType() == 25 && this.b.getPageSetup().getPrintComments() != 0);
               } while(!zatm.a(var8, var1, this.R));

               this.C.o = null;
            } while(!var8.j().isPrintable());

            var3 = (double)this.E;
            var5 = (double)this.D;

            int var9;
            for(var9 = var1.a; var9 < var8.c(); ++var9) {
               var5 += this.Q.getRowHeightInch(var9) * 72.0D * this.H[1];
            }

            if (var8.c() < var1.a) {
               for(var9 = var1.a - 1; var9 >= var8.c(); --var9) {
                  var5 -= this.Q.getRowHeightInch(var9) * 72.0D * this.H[1];
               }
            }

            this.C.j = (float)var5;

            for(var9 = var1.b; var9 < var8.e(); ++var9) {
               var3 += this.Q.c.b(var9) * 72.0D * this.H[0];
            }

            if (var8.e() < var1.b) {
               for(var9 = var1.b - 1; var9 >= var8.e(); --var9) {
                  var3 -= this.Q.c.b(var9) * 72.0D * this.H[0];
               }
            }

            this.C.i = (float)var3;
            if (var2) {
               this.a(var8, var2);
            } else if (!var8.b) {
               com.aspose.cells.b.a.b.zp var17 = new com.aspose.cells.b.a.b.zp(var8.e(), var8.c(), var8.f() - var8.e() + 1, var8.d() - var8.c() + 1);
               com.aspose.cells.b.a.b.zp var10 = new com.aspose.cells.b.a.b.zp(var1.b, var1.a, var1.d - var1.b + 1, var1.c - var1.a + 1);
               if (var10.a(var17)) {
                  this.a(var8, var2);
                  if (!this.aa.g) {
                     var8.b = true;
                  }
               }
            }
         }
      }

      if (this.b.getSparklineGroupCollection() != null && this.b.getSparklineGroupCollection().getCount() > 0) {
         for(int var14 = 0; var14 < this.b.getSparklineGroupCollection().getCount(); ++var14) {
            SparklineGroup var15 = this.b.getSparklineGroupCollection().get(var14);
            SparklineCollection var18 = var15.getSparklineCollection();
            if (var18.b().getIndex() == this.b.getIndex()) {
               for(int var16 = 0; var16 < var18.getCount(); ++var16) {
                  Sparkline var11 = var18.get(var16);
                  if (var11.getRow() >= var1.a && var11.getRow() <= var1.c && var11.getColumn() >= var1.b && var11.getColumn() <= var1.d) {
                     var3 = (double)this.E;
                     var5 = (double)this.D;

                     int var12;
                     for(var12 = var1.a; var12 < var11.getRow(); ++var12) {
                        var5 += this.Q.getRowHeightInch(var12) * 72.0D * this.H[1];
                     }

                     for(var12 = var1.b; var12 < var11.getColumn(); ++var12) {
                        var3 += this.Q.c.b(var12) * 72.0D * this.H[0];
                     }

                     if (var11.c()) {
                        com.aspose.cells.a.d.zb var19 = new com.aspose.cells.a.d.zb();
                        com.aspose.cells.a.d.zb var13 = var11.d();
                        var19.a((com.aspose.cells.a.d.zl)var13);
                        var19.a(new com.aspose.cells.b.a.b.a.zi());
                        var19.a().b((float)var3, (float)var5);
                        var19.a().a((float)this.H[0], (float)this.H[1]);
                        this.C.a((com.aspose.cells.a.d.zl)var19);
                     }
                  }
               }
            }
         }
      }

      return var1;
   }

   private void a(int var1, int var2, int var3, int var4, int var5) throws Exception {
      this.C.b = this;
      ArrayList var6 = this.b(var1, var2, var3, var4, var5);
      Iterator var7 = var6.iterator();

      while(var7.hasNext()) {
         zga var8 = (zga)var7.next();
         float var9 = this.E;
         float var10 = 0.0F;
         int var11 = var8.k();
         if (var8.f < 0) {
            var11 = var8.k() - (var8.m() - 1);
            if (var11 < 0) {
               var11 = 0;
            }
         }

         int var12;
         for(var12 = var3; var12 < var11; ++var12) {
            var10 += (float)this.Q.c.b(var12) * 72.0F * (float)this.H[0];
         }

         this.C.h = 0.0F;
         this.C.k = 0;
         float var13;
         if (var8.f > 0) {
            for(var12 = var11; var12 < var8.k() + var8.m() && var12 <= 16383; ++var12) {
               var13 = (float)this.Q.c.b(var12) * 72.0F * (float)this.H[0];
               this.C.h += var13;
               this.C.k += this.Q.c.a(var12);
            }
         } else {
            for(var12 = var11; var12 <= var8.k() && var12 <= 16383; ++var12) {
               var13 = (float)this.Q.c.b(var12) * 72.0F * (float)this.H[0];
               this.C.h += var13;
               this.C.k += this.Q.c.a(var12);
            }
         }

         var9 += var10;
         if (this.m > 0 && var3 > this.m) {
            var9 += (float)this.F;
         }

         if (this.b.getDisplayRightToLeft()) {
            this.C.i = this.d.m.l() - (var9 - this.d.m.j()) - this.C.h + 1.0F;
         } else {
            this.C.i = var9;
         }

         if (this.a(var8)) {
            this.c(var8);
         }
      }

      var6 = null;
   }

   private boolean a(zga var1) {
      if (var1 == null) {
         return false;
      } else if (var1.f()) {
         return false;
      } else {
         double var2 = 0.0D;
         int var4 = 0;

         for(int var5 = var1.k(); var4 < var1.m(); var5 += var1.f) {
            var2 += (double)this.Q.c.a(var5);
            ++var4;
         }

         return var2 > 0.0D;
      }
   }

   public static void a(ArrayList var0, Workbook var1, String var2) throws Exception {
      boolean var3 = false;
      Iterator var4 = var0.iterator();

      zot var5;
      Font var6;
      while(var4.hasNext()) {
         var5 = (zot)var4.next();
         if (var5.b == null) {
            var5.b = new Font(var1.getWorksheets(), (Object)null, false);
         }

         if (!com.aspose.cells.a.d.zfs.a(var5.b.getName(), var5.b.m(), var5.a)) {
            var6 = var1.getDefaultStyle().q();
            Font var7 = new Font(var1.getWorksheets(), (Object)null, false);
            var7.c(var5.b);
            if (com.aspose.cells.a.d.zfs.a(var6.getName(), var5.b.m(), var5.a)) {
               var7.setName(var6.getName());
               var5.b = var7;
            } else {
               if (!com.aspose.cells.a.d.zfs.a(var2, var5.b.m(), var5.a)) {
                  var3 = true;
                  break;
               }

               var7.setName(var2);
               var5.b = var7;
            }
         }
      }

      if (var3) {
         zgd.a(var0);
         var4 = var0.iterator();

         while(var4.hasNext()) {
            var5 = (zot)var4.next();
            if (!com.aspose.cells.a.d.zfs.a(var5.b.getName(), var5.b.m(), var5.a)) {
               var6 = new Font(var1.getWorksheets(), (Object)null, false);
               var6.c(var5.b);
               var6.setDoubleSize(var5.b.getDoubleSize());
               if (var5.a.length() > 0) {
                  com.aspose.cells.a.d.zfq var8 = com.aspose.cells.a.d.zfs.a(var5.b.m(), var5.a.charAt(0));
                  if (var8 != null) {
                     var6.setName(var8.b());
                     var5.b = var6;
                  }
               }
            }
         }
      }

   }

   private void b(zga var1) throws Exception {
      boolean var2 = false;
      boolean var3 = false;
      if (this.A instanceof com.aspose.cells.a.d.zat) {
         var3 = true;
      }

      Iterator var4;
      zot var5;
      Font var11;
      if (this.z.d()) {
         if (!this.z.c()) {
            var4 = var1.r().iterator();

            label87:
            while(true) {
               while(true) {
                  do {
                     if (!var4.hasNext()) {
                        break label87;
                     }

                     var5 = (zot)var4.next();
                     var1.e = var1.e + var5.a;
                     if (var5.b == null) {
                        var5.b = new Font(this.c.getWorksheets(), (Object)null, false);
                     }
                  } while(com.aspose.cells.a.d.zfs.a(var5.b.getName(), var5.b.m(), var5.a, var3));

                  if (this.z.getWarningCallback() != null) {
                     String var6 = this.a(var1, var5.b);
                     this.z.getWarningCallback().warning(new WarningInfo(0, var6));
                  }

                  var11 = this.c.getDefaultStyle().q();
                  Font var7 = new Font(this.c.getWorksheets(), (Object)null, false);
                  var7.c(var5.b);
                  if (com.aspose.cells.a.d.zfs.a(var11.getName(), var5.b.m(), var5.a, var3)) {
                     var7.setName(var11.getName());
                     var5.b = var7;
                  } else if (com.aspose.cells.a.d.zfs.a(this.y.getName(), var5.b.m(), var5.a, var3)) {
                     var7.setName(this.y.getName());
                     var5.b = var7;
                  } else if (var3 && com.aspose.cells.a.d.zfs.a(com.aspose.cells.a.d.zbw.d, var5.b.m(), var5.a, var3)) {
                     var7.setName(com.aspose.cells.a.d.zbw.d);
                     var5.b = var7;
                  } else {
                     if (!var1.t()) {
                        var2 = true;
                        break label87;
                     }

                     com.aspose.cells.a.d.zfq var8 = null;

                     for(int var9 = 0; var9 < var5.a.length(); ++var9) {
                        char var10 = var5.a.charAt(var9);
                        var8 = com.aspose.cells.a.d.zfs.a(var5.b.m(), var10);
                        if (var8 == null) {
                           var2 = true;
                           break;
                        }
                     }

                     if (var8 != null) {
                        var7.setName(var8.b());
                        var5.b = var7;
                     }
                  }
               }
            }
         } else {
            var2 = true;
         }
      }

      if (var2) {
         zgd.a(var1.r());
         var4 = var1.r().iterator();

         while(var4.hasNext()) {
            var5 = (zot)var4.next();
            if (!com.aspose.cells.a.d.zfs.a(var5.b.getName(), var5.b.m(), var5.a, var3)) {
               var11 = new Font(this.c.getWorksheets(), (Object)null, false);
               var11.c(var5.b);
               var11.setDoubleSize(var5.b.getDoubleSize());
               if (var5.a.length() > 0) {
                  com.aspose.cells.a.d.zfq var12 = com.aspose.cells.a.d.zfs.a(var5.b.m(), var5.a.charAt(0));
                  if (var12 != null) {
                     var11.setName(var12.b());
                     var5.b = var11;
                  }
               }
            }
         }
      }

   }

   private zga a(Row var1, int var2, int var3, int var4, int var5, int var6, int var7, int var8) throws Exception {
      zga var9 = new zga(var2, var3);
      Cell var10;
      if (var1 == null) {
         var10 = null;
      } else {
         var10 = var1.getCellOrNull(var3);
      }

      if (var10 != null) {
         if (var10.I()) {
            var9.a(1);
         }

         var9.c(var10.c.c == 5);
      }

      var9.a(this.b.getDisplayZeros());
      var9.a(var10);
      int var11;
      if (this.o != null && this.o != null && this.o.containsValue(var10)) {
         var9.a("Cell_" + this.b.getIndex() + "_" + var2 + "_" + var3);
         var11 = b(this.U, var9);
         float var12 = (float)(this.d.n / 2.5399999618530273D * 72.0D);
         float var13 = (float)(this.d.o / 2.5399999618530273D * 72.0D);
         this.q.put(var9.h(), "" + var11 + "_" + (var12 + this.C.i - ((zasn)this.U.get(var11)).m.f()) + "_" + (float)(this.x[1] - (double)(this.C.j + var13 - ((zasn)this.U.get(var11)).m.g())));
      }

      int var25;
      if (this.J != null) {
         Iterator var20 = this.J.iterator();

         label292:
         while(var20.hasNext()) {
            zfu var21 = (zfu)var20.next();
            if (var2 >= var21.a && var2 <= var21.c && var3 >= var21.b && var3 <= var21.d) {
               var9.a(var21);
               var9.e(true);
               if (var2 != var21.a && var2 != var5 || var3 != var21.b && var3 != var6) {
                  var9.d(true);
                  return var9;
               }

               var9.e(0);

               for(var25 = var3; var25 <= var21.d; ++var25) {
                  var9.e(var9.m() + 1);
               }

               var9.d(0);
               var25 = var2;

               while(true) {
                  if (var25 > var21.c) {
                     break label292;
                  }

                  var9.d(var9.l() + 1);
                  ++var25;
               }
            }
         }
      }

      for(var11 = this.b.getHyperlinks().getCount() - 1; var11 >= 0; --var11) {
         CellArea var23 = this.b.getHyperlinks().get(var11).getArea();
         if (var2 >= var23.StartRow && var2 <= var23.EndRow && var3 >= var23.StartColumn && var3 <= var23.EndColumn) {
            var9.a(this.b.getHyperlinks().get(var11));
            break;
         }
      }

      int var14;
      int var24;
      if (var9.n()) {
         var25 = var9.o().a;
         var14 = var9.o().b;
         Cell var22;
         if (var2 == var25 && var3 == var14) {
            var22 = var10;
            var24 = var4;
         } else {
            Row var15 = this.Q.getRows().a.b(var25);
            var24 = var15 == null ? 15 : var15.d();
            if (var15 == null) {
               var22 = null;
            } else {
               var22 = var15.getCellOrNull(var14);
            }
         }

         this.a(var22, var24, var25, var14, (Cell)null);
         if (var22 != null && var2 == var25 && var3 == var14) {
            var9.b = this.ac.d;
            var9.c(var22.getType());
         }

         var9.a(this.ac.a);
         var9.j = this.ac.c;
         int var16 = var9.o().c;
         int var17 = var9.o().d;
         Row var18 = this.Q.getRows().a.b(var16);
         int var19 = var18 == null ? 15 : var18.d();
         Cell var31;
         if (var18 == null) {
            var31 = null;
         } else {
            var31 = var18.getCellOrNull(var17);
         }

         this.a(var31, var19, var16, var17, var22);
         var9.i = this.ac.a;
      } else {
         this.a(var10, var4, var2, var3, (Cell)null);
         if (var10 != null) {
            var9.b = this.ac.d;
            var9.c(var10.getType());
         }

         var9.a(this.ac.a);
         var9.j = this.ac.c;
      }

      if (var9.q()) {
         var11 = var10.getType();
         boolean var26;
         label243:
         switch(var9.c().getHorizontalAlignment()) {
         case 1:
            var9.b(1);
            break;
         case 2:
            var9.b(1);
            var9.b(true);
            break;
         case 3:
            var9.b(3);
            break;
         case 4:
            var9.b(7);
            break;
         case 5:
            switch(var11) {
            case 0:
               var9.b(1);
               break label243;
            case 1:
               var9.b(8);
               break label243;
            case 2:
            case 3:
            default:
               var9.b(1);
               break label243;
            case 4:
               if (var9.c().getNumber() == zapa.b) {
                  var9.b(7);
               } else {
                  var26 = false;
                  if (var26) {
                     var9.b(7);
                  } else {
                     var9.b(8);
                  }
               }
               break label243;
            case 5:
               if (var10 != null && zar.b(var10.j())) {
                  var9.b(8);
               } else {
                  var24 = var9.c().getRotationAngle();
                  if (var24 != 90 && (var24 >= 0 || var24 <= -90)) {
                     var9.b(7);
                  } else {
                     var9.b(8);
                  }
               }
               break label243;
            }
         case 6:
            var9.b(6);
            break;
         case 7:
            if (var9.c().getIndentLevel() != 0) {
               var9.a(72.0F * (float)zatm.b(var9.c().getIndentLevel(), this.G.getFont(), (double)this.ad.a) / this.N);
               var9.f(var9.s() + (int)zatm.b(var9.c().getIndentLevel(), this.G.getFont(), (double)this.ad.a));
            }

            var9.b(7);
            break;
         case 8:
            if (var9.c().getIndentLevel() != 0) {
               var9.a(72.0F * (float)zatm.b(var9.c().getIndentLevel(), this.G.getFont(), (double)this.ad.a) / this.N);
               var9.f(var9.s() + (int)zatm.b(var9.c().getIndentLevel(), this.G.getFont(), (double)this.ad.a));
            } else if (var11 == 4) {
               var26 = false;
               if (var26) {
                  var9.b(7);
               } else {
                  var9.b(8);
               }
            } else if (var11 == 5) {
               var26 = false;
               if (var26) {
                  var9.b(7);
               } else {
                  var9.b(8);
               }
            }

            var9.b(8);
         }
      }

      if (var9.c().d() != null) {
         var9.c = var9.c().getBorders().getByBorderType(32);
         var9.d = var9.c().getBorders().getByBorderType(16);
      }

      if (var9.c().isTextWrapped() && var9.q()) {
         var9.c().setShrinkToFit(false);
      }

      zot var30;
      if (var9.h() != null) {
         if (var9.h().getType() == 1 && var9.h().getDoubleValue() < 0.0D) {
            var9.a(new ArrayList());
            zot var28 = new zot();
            var28.b = var9.c().getFont();
            var28.a = zatm.a(this.Q.c.a(var9.k()), '#', var9.c().getFont());
            com.aspose.cells.b.a.a.ze.a(var9.r(), (Object)var28);
            var9.e = var28.a;
         } else if (!var9.h().c.b()) {
            this.X.a((double)(var9.a(this.Q, this.G) - 2));
            this.X.a(var9.h().r());
            zxz var27 = Cell.a(var9.h().c.d(), this.W, var9.c(), this.Q);
            var9.a(var9.h().a(this.W, var9.c()));
            if (var9.r().size() > 1 && zar.b(var9.h().getStringValue())) {
               Collections.reverse(var9.r());
            }

            if (var9.r().size() > 1) {
               for(var24 = var9.r().size() - 1; var24 >= 0; --var24) {
                  var30 = (zot)var9.r().get(var24);
                  if (var30.a.trim().length() != 0) {
                     break;
                  }

                  var9.r().remove(var24);
               }
            }

            this.a(var9, var27);
         }
      }

      if (var9.r() != null) {
         boolean var29 = zar.b(var9.r());
         if (var29 || zar.a(var9.r())) {
            zcm var33 = new zcm();
            var33.a(var9.r(), var29);
         }

         var9.f(var29);
         if (var9.r().size() > 0) {
            this.b(var9);
         }

         if (var9.e() == -1 && var9.r().size() == 1) {
            zot var34 = (zot)var9.r().get(0);
            String var32 = var34.b.getName();
            var34.b.c(var9.c().getFont());
            var34.b.setColor(zatm.a(var9.c(), var9.c().getFont(), var10));
            var34.b.setName(var32);
         }

         Iterator var35 = var9.r().iterator();

         while(var35.hasNext()) {
            var30 = (zot)var35.next();
            if (var9.h() != null && var9.h().getType() == 4) {
               var30.b.setColor(var9.c().getFont().getColor());
            }

            if (var30.a != null) {
               var30.a = com.aspose.cells.b.a.zv.a(var30.a, "\u009f", "");
            }

            var14 = zatm.b(var30.a, var30.b, (double)this.ad.a);
            var9.f(var9.s() + var14);
         }

         if (var9.r().size() > 0) {
            var9.f(var9.s() + 2);
         }
      }

      return var9;
   }

   private long a(int var1, int var2) {
      if (this.J != null && this.J.size() > 0) {
         for(int var3 = this.J.size() - 1; var3 >= 0; --var3) {
            zfu var4 = (zfu)this.J.get(var3);
            if (var4.a <= var1 && var4.c >= var1 && var4.b <= var2 && var4.d >= var2) {
               for(int var5 = var4.b; var5 <= var4.d; ++var5) {
                  if (this.Q.c.a(var5) > 0) {
                     for(int var6 = var4.a; var6 <= var4.c; ++var6) {
                        if (this.Q.getRowHeightPixel(var6) > 0) {
                           return ((long)var4.a << 20) + (long)var4.b;
                        }
                     }
                  }
               }
            }
         }
      }

      return -1L;
   }

   private String a(double var1, Font var3) throws Exception {
      String var4 = "";
      if (var3 == null) {
         return var4;
      } else {
         double var5 = (double)zatm.b("##########", var3, (double)this.ad.a) / 10.0D;
         int var7 = (int)(var1 / var5);

         for(int var8 = 0; var8 < var7; ++var8) {
            var4 = var4 + "#";
         }

         return var4;
      }
   }

   private ArrayList b(int var1, int var2, int var3, int var4, int var5) throws Exception {
      ArrayList var6 = new ArrayList();
      Row var7 = this.Q.getRows().a.b(var1);
      int var8 = var7 == null ? 15 : var7.d();

      for(int var9 = var3; var9 <= var5; ++var9) {
         if (this.Q.c.a(var9) != 0 || this.a(var1, var9) >= 0L) {
            zga var10 = this.a(var7, var1, var9, var8, var2, var3, var4, var5);
            if (var10.f()) {
               var9 = var10.o().d;
            } else {
               com.aspose.cells.b.a.a.ze.a(var6, (Object)var10);
               zga var12;
               zga var13;
               float[] var14;
               int[] var15;
               boolean var16;
               float var17;
               if (var10.g() == 7 && var9 <= var5 && var10.c().getVerticalAlignment() != 6) {
                  if (var10.q() && !var10.n() && !var10.c().isTextWrapped() && var10.i() == 5 && !var10.c().getShrinkToFit()) {
                     if (this.b.getDisplayRightToLeft()) {
                        this.a(var6, var10);
                     } else {
                        var17 = (float)var10.s() / this.N * 72.0F;
                        var12 = this.a(var7, var1, var9 + 1, var8, var2, var3, var4, var5);
                        var13 = var10;

                        while(true) {
                           var14 = new float[]{var17};
                           var15 = new int[]{var9};
                           var16 = this.a(var10, var13, var12, var14, var15, var6);
                           var17 = var14[0];
                           var9 = var15[0];
                           if (var16 || var9 >= this.w) {
                              break;
                           }

                           var12 = this.a(var7, var1, var9 + 1, var8, var2, var3, var4, var5);
                        }
                     }
                  }
               } else if (var10.g() == 1) {
                  if (var10.b()) {
                     zga var11 = var10;

                     while(var9 <= var5) {
                        ++var9;
                        var12 = this.a(var7, var1, var9, var8, var2, var3, var4, var5);
                        if (var12.q() || var12.c() == null || var12.c().getHorizontalAlignment() != 2) {
                           --var9;
                           break;
                        }

                        var10.e(var10.m() + 1);
                        var11.b((Border)null);
                        var12.a((Border)null);
                        var11 = var12;
                        com.aspose.cells.b.a.a.ze.a(var6, (Object)var12);
                     }
                  }
               } else if (var10.g() == 8 && var10.q() && !var10.n() && !var10.c().isTextWrapped() && var10.i() == 5 && !var10.c().getShrinkToFit()) {
                  if (this.b.getDisplayRightToLeft()) {
                     var17 = (float)var10.s() / this.N * 72.0F;
                     var12 = this.a(var7, var1, var9 + 1, var8, var2, var3, var4, var5);
                     var13 = var10;

                     while(true) {
                        var14 = new float[]{var17};
                        var15 = new int[]{var9};
                        var16 = this.a(var10, var13, var12, var14, var15, var6);
                        var17 = var14[0];
                        var9 = var15[0];
                        if (var16 || var9 >= this.w) {
                           break;
                        }

                        var12 = this.a(var7, var1, var9 + 1, var8, var2, var3, var4, var5);
                     }
                  } else {
                     this.a(var6, var10);
                  }
               }

               if (var10.r() != null && var10.r().size() != 0) {
                  zot var18 = (zot)var10.r().get(0);
                  if (var10.h() != null) {
                     int var19 = var10.a(this.Q, this.G);
                     this.X.a((double)(var19 - 2));
                     this.X.a(var10.h().r());
                     zxz var20 = Cell.a(var10.h().c.d(), this.W, var10.c(), this.Q);
                     if (var20 != null) {
                        switch(var10.i()) {
                        case 0:
                        case 1:
                        case 2:
                        case 4:
                           double var21 = (double)(var19 - 2) * this.H[0];
                           if (var20.e()) {
                              var18.a = this.a(var21, var18.b);
                           } else if (!var10.c().getShrinkToFit()) {
                              int var22 = zatm.b(var18.a, var18.b, (double)this.ad.a);
                              if ((double)var22 > var21) {
                                 var18.a = this.a(var21, var18.b);
                              }
                           }
                        case 3:
                        }
                     }
                  }
               }
            }
         }
      }

      return var6;
   }

   void a(zga var1, zxz var2) {
      if (var2 != null && var2.j() != 0) {
         int var3 = 0;
         ArrayList var4 = var1.r();
         String var5 = var2.h();
         zot var6 = (zot)var4.get(0);
         Font var7 = var6.b;
         var4.clear();

         for(int var8 = var2.j() - 1; var8 >= 0; --var8) {
            String var9 = null;
            if (!var1.a && var2.a(var8)) {
               var3 = var2.b(var8);
               var9 = var5.substring(var3);
               if (var9 != null && var9.length() > 0) {
                  var6 = new zot();
                  var6.a = var9;
                  var6.b = var7;
                  var4.add(0, var6);
                  var5 = var5.substring(0, 0 + var3);
               }

               var6 = new zot();
               var6.a = "";
               var6.b = var7;
               var6.d = 1;
               var4.add(0, var6);
               var1.a = true;
            } else {
               var3 = var2.b(var8);
               var9 = var5.substring(var3);
               if (var9 != null && var9.length() > 0) {
                  var6 = new zot();
                  var6.a = var9;
                  var6.b = var7;
                  var4.add(0, var6);
               }

               var5 = var5.substring(0, 0 + var3);
               var6 = new zot();
               var6.a = "" + var2.c(var8);
               var6.d = 4;
               var6.b = var7;
               var4.add(0, var6);
            }
         }

         if (var3 > 0) {
            var6 = new zot();
            var6.a = var5.substring(0, 0 + var3);
            var6.b = var7;
            var4.add(0, var6);
         }

      }
   }

   boolean a(zga var1, zga var2, zga var3, float[] var4, int[] var5, ArrayList var6) {
      if (this.Q.c.a(var3.k()) == 0 || !var3.q() && !var3.n() && (var3.i() == 3 || var3.r() == null)) {
         if ((double)var4[0] < this.Q.c.b(var2.k()) * 72.0D * this.H[0]) {
            return true;
         } else {
            var3.a((Border)null);
            var2.b((Border)null);
            var1.e(var1.m() + 1);
            ++var5[0];
            var4[0] -= (float)(this.Q.c.b(var3.k()) * 72.0D * this.H[0]);
            if (!var3.d() && (var3.c() == null || var3.c().getBackgroundColor().isEmpty())) {
               if (var2.c() != null && !var2.c().getBackgroundColor().isEmpty() && (var3.c() == null || var3.c().getBackgroundColor().isEmpty())) {
                  var3.g(true);
                  com.aspose.cells.b.a.a.ze.a(var6, (Object)var3);
               }
            } else {
               com.aspose.cells.b.a.a.ze.a(var6, (Object)var3);
            }

            return false;
         }
      } else {
         return true;
      }
   }

   private void a(ArrayList var1, zga var2) {
      zga var3 = var2;
      if (var1.size() != 0 && (var2.h() == null || !var2.h().c.e())) {
         boolean var4 = false;
         double var5 = (double)((float)var2.s() * 72.0F / this.N) - this.Q.c.b(var2.k()) * 72.0D * this.H[0];
         if (var5 > 0.0D) {
            int var7 = 1;

            for(int var9 = var1.size() - 2; var9 >= 0 && var5 >= 0.0D; --var9) {
               zga var8 = (zga)var1.get(var9);
               if (var8 != null && (var8.r() != null || this.a(var2.j(), var8.k()) >= 0L)) {
                  break;
               }

               var5 -= this.Q.c.b(var8.k()) * 72.0D * this.H[0];
               var2.f = -1;
               var7 = var2.k() - var8.k() + 1;
               var8.b((Border)null);
               var3.a((Border)null);
               var3 = var8;
            }

            var2.e(var7);
         }
      }
   }

   private void c(zga var1) throws Exception {
      this.C.t = this.A;
      this.d(var1);
      this.C.D = var1;
      if (this.C.g != 0.0F) {
         this.C.b();
         this.C.h();
         this.C.k();
         if (var1.q() && var1.r() != null) {
            this.C.E = var1.r();
            this.C.D = var1;
            if (this.z.getDrawObjectEventHandler() != null) {
               this.z.getDrawObjectEventHandler().a(this.C);
            }

            this.C.a();
         }

         this.C.o = null;
      }
   }

   private void a(zbgq var1, boolean var2) throws Exception {
      ArrayList var3 = a;
      synchronized(a) {
         switch(var1.i()) {
         case 5:
         case 8:
            try {
               this.c(var1, var2);
            } catch (Exception var6) {
               com.aspose.cells.a.c.zl.b(var6);
               throw new CellsException(0, "Chart to image Error!");
            }

            return;
         default:
            try {
               this.b(var1, var2);
            } catch (Exception var7) {
               com.aspose.cells.a.c.zl.b(var7);
               throw new CellsException(13, "Shape to image Error!");
            }

         }
      }
   }

   private void b(zbgq var1, boolean var2) throws Exception {
      this.C.w = (float)((double)var1.j().W().j() * this.H[0]) * 72.0F / this.N;
      this.C.x = (float)((double)var1.j().W().k() * this.H[1]) * 72.0F / this.N;
      this.C.h = Math.max((float)((double)var1.j().W().h() * this.H[0]), 1.0F) * 72.0F / this.N;
      this.C.g = Math.max((float)((double)var1.j().W().i() * this.H[1]), 1.0F) * 72.0F / this.N;
      var1.j().t = true;
      ImageOrPrintOptions var3 = new ImageOrPrintOptions();
      var3.setImageFormat(this.A.e);
      int var4 = var1.j().getWidth();
      int var5 = var1.j().getHeight();
      if (!(this.A instanceof com.aspose.cells.a.d.zat)) {
         var1.j().s = true;
      }

      if (this.C.g * this.C.h != 0.0F && var1.j().W().i() * var1.j().W().h() > 0.0F) {
         com.aspose.cells.b.a.b.zq var6;
         if (this.b.getDisplayRightToLeft()) {
            var6 = new com.aspose.cells.b.a.b.zq(this.d.m.l() - (this.C.i + this.C.w - this.d.m.j()) - this.C.h + 1.0F, this.C.j + this.C.x, (float)((double)var1.j().W().h() * this.H[0] * 72.0D / (double)this.N), (float)((double)var1.j().W().i() * this.H[1] * 72.0D / (double)this.N));
         } else {
            var6 = new com.aspose.cells.b.a.b.zq(this.C.i + this.C.w, this.C.j + this.C.x, (float)((double)var1.j().W().h() * this.H[0] * 72.0D / (double)this.N), (float)((double)var1.j().W().i() * this.H[1] * 72.0D / (double)this.N));
         }

         com.aspose.cells.a.d.zb var7 = new com.aspose.cells.a.d.zb();
         com.aspose.cells.a.d.zb var8 = new com.aspose.cells.a.d.zb();
         com.aspose.cells.a.d.zb var9 = zbfo.a(var1.j());
         var8.a((com.aspose.cells.a.d.zl)var9);
         var8.a(new com.aspose.cells.b.a.b.a.zi());
         var8.a().b(var6.f(), var6.g());
         var8.a().a((float)this.H[0], (float)this.H[1]);
         var7.a((com.aspose.cells.a.d.zl)var8);
         this.a(var7, var1, var6);
         if (this.z.getDrawObjectEventHandler() != null) {
            com.aspose.cells.b.a.d.zh var10 = new com.aspose.cells.b.a.d.zh();
            com.aspose.cells.a.d.zm var11 = new com.aspose.cells.a.d.zm(var1.j().W().h() * 72.0F / this.N, var1.j().W().i() * 72.0F / this.N);
            var11.a(var9);
            zam var12 = new zam();
            var12.a(var11, var10.j());
            var10.a(0L, 0);
            this.z.getDrawObjectEventHandler().a(var10, var6);
         }

         if (!var2) {
            var7.a(new com.aspose.cells.a.d.zam(var6.f() - 0.5F, var6.g() - 0.5F, var6.h() + 1.0F, var6.i() + 1.0F, this.Q.h().getDisplayRightToLeft()));
         }

         this.C.a((com.aspose.cells.a.d.zl)var7);
      }

      var1.j().setWidth(var4);
      var1.j().setHeight(var5);
   }

   private com.aspose.cells.b.a.d.zh a(zbgq var1, int var2) throws Exception {
      com.aspose.cells.b.a.d.zh var3 = new com.aspose.cells.b.a.d.zh();
      if (this.M.get(var2) == null) {
         if (var2 < 0 || var2 >= this.K.Q().b().getCount()) {
            var3.a(0L, 0);
            return var3;
         }

         zcb var4 = this.K.Q().b().a(var2);
         zatx var5 = zaty.a(var4);
         if (var5.a() != null) {
            if (var1.j().getFormatPicture().getBrightness() == 0.0D && var1.j().getFormatPicture().getContrast() == 0.0D) {
               var3.b(var5.a(), 0, var5.a().length);
            } else {
               var1.j().a((com.aspose.cells.b.a.d.zm)var3, (ImageFormat)ImageFormat.getPng());
            }

            var3.a(0L, 0);
            int var6 = com.aspose.cells.a.d.zbn.a((com.aspose.cells.b.a.d.zm)var3);
            if (var6 != 1 && var6 != 2) {
               com.aspose.cells.b.a.b.zj var7 = com.aspose.cells.b.a.b.zj.a((com.aspose.cells.b.a.d.zm)var3);
               var3 = new com.aspose.cells.b.a.d.zh();
               if (var7.i() >= 8 && var7.h() >= 8) {
                  switch(var7.c()) {
                  case 15:
                  case 65536:
                  case 131072:
                  case 197634:
                  case 198659:
                  case 1060876:
                     this.a((com.aspose.cells.b.a.b.zj)var7, (com.aspose.cells.b.a.d.zm)var3);
                     break;
                  case 137224:
                  case 139273:
                     com.aspose.cells.a.d.zbn.a(var7, var3, 100L);
                     break;
                  default:
                     this.a((com.aspose.cells.b.a.b.zj)var7, (com.aspose.cells.b.a.d.zm)var3);
                  }
               } else {
                  com.aspose.cells.a.d.zbn.a((com.aspose.cells.b.a.b.zj)var7, (com.aspose.cells.b.a.d.zm)var3);
               }

               var7.d();
               var3.a(0L, 0);
               this.M.put(var2, var3);
               return var3;
            }

            return var3;
         }
      }

      var3 = (com.aspose.cells.b.a.d.zh)this.M.get(var2);
      var3.a(0L, 0);
      return var3;
   }

   private com.aspose.cells.b.a.d.zh a(zbgq var1) throws Exception {
      new com.aspose.cells.b.a.d.zh();
      int var2;
      switch(var1.j().getMsoDrawingType()) {
      case 5:
         Chart var4 = ((ChartShape)var1.j()).a();
         float var5 = 0.0F;
         float var6 = (float)this.b.getPageSetup().getZoom() / 100.0F;
         if ((double)var6 > this.H[1] && (double)var6 < this.H[0]) {
            var5 = var6;
         } else {
            var5 = (float)(this.H[0] + this.H[1]) / 2.0F;
         }

         int var7 = var4.getChartObject().getWidth();
         int var8 = var4.getChartObject().getHeight();
         var4.getChartObject().setWidth((int)((double)var4.getChartObject().getWidth() * (this.H[0] / (double)var5)));
         var4.getChartObject().setHeight((int)((double)var4.getChartObject().getHeight() * (this.H[1] / (double)var5)));
         if (!(this.A instanceof com.aspose.cells.a.d.zat)) {
            var4.d = true;
         }

         com.aspose.cells.b.a.d.zh var3 = new com.aspose.cells.b.a.d.zh();
         if (com.aspose.cells.a.d.zei.a()) {
            var4.a(var3, 90L);
         } else {
            var4.a((com.aspose.cells.b.a.d.zm)var3, (ImageFormat)this.A.e);
         }

         var3.a(0L, 0);
         var4.getChartObject().setWidth(var7);
         var4.getChartObject().setHeight(var8);
         var4.d = false;
         return var3;
      case 8:
         var2 = ((Picture)var1.j()).b() - 1;
         return this.a(var1, var2);
      case 24:
         var2 = ((OleObject)var1.j()).e() - 1;
         return this.a(var1, var2);
      default:
         boolean var9 = false;
         return null;
      }
   }

   private com.aspose.cells.a.d.zb a(zbgq var1, com.aspose.cells.b.a.d.zm var2, com.aspose.cells.b.a.b.zq var3) throws Exception {
      com.aspose.cells.a.d.zb var4 = new com.aspose.cells.a.d.zb();
      Shape var5 = var1.j();
      FillFormat var6 = var5.getFill();
      int[] var7 = var5.c(var5.getRotationAngle());
      boolean var8 = false;
      int var59;
      if (var5.getRotationAngle() >= 0.0D) {
         var59 = (int)(var5.getRotationAngle() + 0.5D);
      } else {
         var59 = (int)(var5.getRotationAngle() - 0.5D);
      }

      boolean var9 = this.b(var59);
      float var10 = (float)this.H[0];
      float var11 = (float)this.H[1];
      if (var9) {
         var10 = (float)this.H[1];
         var11 = (float)this.H[0];
      }

      float var12 = (float)var7[3] * 72.0F / this.N;
      float var13 = (float)var7[2] * 72.0F / this.N;
      com.aspose.cells.b.a.b.zq var14 = new com.aspose.cells.b.a.b.zq(0.0F, 0.0F, var13, var12);
      int var15 = com.aspose.cells.a.d.zbn.a(var2);
      boolean var16 = false;
      if (var15 != 1 && var15 != 2) {
         var16 = true;
      }

      if (var16) {
         var2 = this.b(var5, var2);
      }

      com.aspose.cells.a.d.zj var17 = com.aspose.cells.a.d.zj.a(var14.d(), var14.e(), var2);
      com.aspose.cells.b.a.b.zt var18 = new com.aspose.cells.b.a.b.zt((float)var17.f().f(), (float)var17.f().g());
      var2.b(0L);
      if (this.a(var5, var15)) {
         var2 = this.a(var5, var2);
         var2.b(0L);
      }

      var17 = null;
      com.aspose.cells.a.d.zj var19 = com.aspose.cells.a.d.zj.a(new com.aspose.cells.b.a.b.zo(0.0F, 0.0F), var18, var2);
      if ((double)(var19.f().b() * var19.f().c()) < 1.0E-4D) {
         return var4;
      } else {
         com.aspose.cells.a.d.zb var20;
         if (var5.getFill().getType() == 2) {
            var20 = new com.aspose.cells.a.d.zb();
            com.aspose.cells.b.a.b.zq var21 = new com.aspose.cells.b.a.b.zq(0.0F, 0.0F, var13, var12);
            Color var22 = this.a(var6.getSolidFill().getTransparency(), var6.getSolidFill().getColor());
            com.aspose.cells.b.a.b.zu var23 = new com.aspose.cells.b.a.b.zu(var22);
            com.aspose.cells.a.d.zn var24 = new com.aspose.cells.a.d.zn(var21);
            var24.a((com.aspose.cells.b.a.b.zc)var23);
            var20.a((com.aspose.cells.a.d.zl)var24);
            com.aspose.cells.b.a.b.zq var25 = new com.aspose.cells.b.a.b.zq(0.0F, 0.0F, var13 * var10, var12 * var11);
            com.aspose.cells.b.a.b.a.zi var26 = this.a(var5, var25);
            var26.a(var10, var11);
            var20.a(var26);
            var4.a((com.aspose.cells.a.d.zl)var20);
         } else if (var5.getFill().getType() != 3 && var5.getFill().getType() != 5 && var5.getFill().getType() == 4) {
            ;
         }

         var20 = new com.aspose.cells.a.d.zb();
         var20.a((com.aspose.cells.a.d.zl)var19);
         MsoFormatPicture var60 = var5.getFormatPicture();
         double var61 = var60.getLeftCrop();
         double var62 = var60.getRightCrop();
         double var63 = var60.getTopCrop();
         double var28 = var60.getBottomCrop();
         if (var16) {
            var61 = 0.0D;
            var62 = 0.0D;
            var63 = 0.0D;
            var28 = 0.0D;
         }

         float var30 = (float)((double)var19.c().b() * var61);
         float var31 = (float)((double)var19.c().c() * var63);
         float var10000 = (float)((double)var19.c().b() * var62);
         var10000 = (float)((double)var19.c().c() * var28);
         float var34 = (float)((double)var19.c().b() * (1.0D - var61 - var62));
         float var35 = (float)((double)var19.c().c() * (1.0D - var63 - var28));
         float var36 = 1.0F;
         float var37 = 1.0F;
         var36 = var14.h() / var34;
         var37 = var14.i() / var35;
         com.aspose.cells.b.a.b.zq var38 = new com.aspose.cells.b.a.b.zq(var14.f(), var14.g(), var14.h() / var36, var14.i() / var37);
         var38.a(var38.f() + var30);
         var38.b(var38.g() + var31);
         var38.a(0.5F, 0.5F);
         if (!var16) {
            var20.a(new com.aspose.cells.a.d.zn(var38));
         }

         com.aspose.cells.b.a.b.zq var39 = new com.aspose.cells.b.a.b.zq(var14.f() * var10, var14.g() * var11, var14.h() * var10, var14.i() * var11);
         com.aspose.cells.b.a.b.a.zi var40 = this.a(var5, var39);
         var40.a(var10 * var36, var11 * var37);
         var40.b(-var30, -var31);
         var20.a(var40);
         var4.a((com.aspose.cells.a.d.zl)var20);
         MsoLineFormat var41 = var5.getLineFormat();
         com.aspose.cells.b.a.b.zq var48;
         if (var41.isVisible()) {
            com.aspose.cells.a.d.zb var42 = new com.aspose.cells.a.d.zb();
            float var43 = (float)var41.getWeight();
            if (var43 < 0.75F) {
               var43 = 0.75F;
            }

            Color var44 = this.a(var41.getTransparency(), var41.getForeColor());
            com.aspose.cells.a.d.zs var45 = new com.aspose.cells.a.d.zs(var44, var43);
            this.a(var41, var45);
            com.aspose.cells.b.a.b.zq var46 = new com.aspose.cells.b.a.b.zq(-var43 / 2.0F, -var43 / 2.0F, var13 + var43, var12 + var43);
            if (var59 != 0) {
               var46.a(-0.5F, -0.5F);
            }

            com.aspose.cells.a.d.zn var47 = new com.aspose.cells.a.d.zn(var46);
            var47.a = var45;
            var42.a((com.aspose.cells.a.d.zl)var47);
            var48 = new com.aspose.cells.b.a.b.zq(var46.f() * var10, var46.g() * var11, var46.h() * var10, var46.i() * var11);
            com.aspose.cells.b.a.b.a.zi var49 = this.a(var5, var48);
            var49.a(var10, var11);
            var42.a(var49);
            var4.a((com.aspose.cells.a.d.zl)var42);
         }

         com.aspose.cells.b.a.b.a.zi var50 = new com.aspose.cells.b.a.b.a.zi();
         var50.b(var3.f(), var3.g());
         var4.a(var50);
         com.aspose.cells.a.d.zb var51 = new com.aspose.cells.a.d.zb();
         var51.a((com.aspose.cells.a.d.zl)var4);
         if (var5.getHyperlink() != null) {
            if (this.o != null && this.o.containsKey(var5.getHyperlink())) {
               Cell var53 = (Cell)((Cell)this.o.get(var5.getHyperlink()));
               this.r.put(var5, var53);
               com.aspose.cells.a.d.zi var55 = new com.aspose.cells.a.d.zi(new com.aspose.cells.b.a.b.zq(var3.f(), var3.g(), var3.h(), var3.i()), "#shape_" + var5.hashCode());
               this.p.put(var5, var55);
               this.C.a.a((com.aspose.cells.a.d.zl)var55);
            } else {
               com.aspose.cells.b.a.b.zq var52 = this.a(var5.getRotationAngle(), var3);
               com.aspose.cells.b.a.b.zo[] var54 = new com.aspose.cells.b.a.b.zo[]{new com.aspose.cells.b.a.b.zo(var52.f(), var52.g()), new com.aspose.cells.b.a.b.zo(var52.f(), var52.m()), new com.aspose.cells.b.a.b.zo(var52.l(), var52.g()), new com.aspose.cells.b.a.b.zo(var52.l(), var52.m())};
               com.aspose.cells.b.a.b.a.zi var56 = new com.aspose.cells.b.a.b.a.zi();
               com.aspose.cells.b.a.b.zo var57 = new com.aspose.cells.b.a.b.zo(var52.f() + var52.h() / 2.0F, var52.g() + var52.i() / 2.0F);
               var56.a((float)var5.getRotationAngle(), var57);
               var56.a(var54);
               var48 = this.a(var54);
               com.aspose.cells.a.d.zi var58 = new com.aspose.cells.a.d.zi(var48, com.aspose.cells.b.a.zv.a(var5.getHyperlink().getAddress(), "\\", "/"));
               var51.a((com.aspose.cells.a.d.zl)var58);
            }
         }

         return var51;
      }
   }

   private com.aspose.cells.b.a.d.zm a(Shape var1, com.aspose.cells.b.a.d.zm var2) throws Exception {
      try {
         Color var3 = var1.getFormatPicture().a.b.b(var1.L().n());
         com.aspose.cells.b.a.d.zh var4 = new com.aspose.cells.b.a.d.zh();
         com.aspose.cells.b.a.b.za var5 = new com.aspose.cells.b.a.b.za(var2);

         try {
            com.aspose.cells.b.a.b.za var6 = new com.aspose.cells.b.a.b.za(var5.i(), var5.h());

            try {
               var6.a(var5.j(), var5.k());
               com.aspose.cells.b.a.b.zi var7 = com.aspose.cells.b.a.b.zi.a((com.aspose.cells.b.a.b.zj)var6);

               try {
                  var7.a((com.aspose.cells.b.a.b.zj)var5, (com.aspose.cells.b.a.b.zn)(new com.aspose.cells.b.a.b.zn(0, 0)));

                  for(int var8 = 0; var8 < var6.i(); ++var8) {
                     for(int var9 = 0; var9 < var6.h(); ++var9) {
                        Color var10 = var6.a(var8, var9);
                        if (this.a(var10, var3, 15)) {
                           var6.a(var8, var9, Color.a(0, (Color)var3));
                        }
                     }
                  }

                  var6.a(var4, ImageFormat.getPng());
                  return var4;
               } finally {
                  if (var7 != null) {
                     var7.d();
                  }

               }
            } finally {
               if (var6 != null) {
                  var6.b();
               }

            }
         } finally {
            if (var5 != null) {
               var5.b();
            }

         }
      } catch (Exception var29) {
         return var2;
      }
   }

   private boolean a(Shape var1, int var2) {
      if (var2 == 1) {
         return false;
      } else if (var2 == 2) {
         return false;
      } else if (var2 == 0) {
         return false;
      } else if (var1.getFormatPicture() == null) {
         return false;
      } else if (var1.getFormatPicture().a == null) {
         return false;
      } else if (!var1.getFormatPicture().a.b.b(2)) {
         return false;
      } else {
         return var1.getFormatPicture().a.b != null;
      }
   }

   private boolean a(Color var1, Color var2, int var3) {
      if (!this.a(var1.getA() & 255, var2.getA() & 255, var3)) {
         return false;
      } else if (!this.a(var1.getR() & 255, var2.getR() & 255, var3)) {
         return false;
      } else if (!this.a(var1.getG() & 255, var2.getG() & 255, var3)) {
         return false;
      } else {
         return this.a(var1.getB() & 255, var2.getB() & 255, var3);
      }
   }

   private boolean a(int var1, int var2, int var3) {
      return Math.abs(var1 - var2) <= var3;
   }

   private com.aspose.cells.b.a.d.zm b(Shape var1, com.aspose.cells.b.a.d.zm var2) throws Exception {
      com.aspose.cells.b.a.b.zj var3 = com.aspose.cells.b.a.b.zj.a(var2);
      double var4 = var1.getFormatPicture().getLeftCrop();
      double var6 = var1.getFormatPicture().getRightCrop();
      double var8 = var1.getFormatPicture().getTopCrop();
      double var10 = var1.getFormatPicture().getBottomCrop();
      if (var4 == 0.0D && var6 == 0.0D && var8 == 0.0D && var10 == 0.0D) {
         return var2;
      } else {
         int var12 = (int)((double)var3.m().b() * var4 + 0.5D);
         int var13 = (int)((double)var3.m().c() * var8 + 0.5D);
         int var14 = (int)((double)var3.m().b() * (1.0D - var4 - var6) + 0.5D);
         int var15 = (int)((double)var3.m().c() * (1.0D - var8 - var10) + 0.5D);
         com.aspose.cells.b.a.b.zq var16 = new com.aspose.cells.b.a.b.zq((float)var12, (float)var13, (float)var14, (float)var15);
         com.aspose.cells.b.a.b.za var17 = new com.aspose.cells.b.a.b.za(var14, var15);
         com.aspose.cells.b.a.b.zi var18 = com.aspose.cells.b.a.b.zi.a((com.aspose.cells.b.a.b.zj)var17);
         com.aspose.cells.b.a.b.zq var19 = new com.aspose.cells.b.a.b.zq(0.0F, 0.0F, (float)var14, (float)var15);
         var18.a(var3, (com.aspose.cells.b.a.b.zq)var19, (com.aspose.cells.b.a.b.zq)var16, 2);
         com.aspose.cells.b.a.d.zh var20 = new com.aspose.cells.b.a.d.zh();
         var17.a(var20, ImageFormat.getPng());
         var18.e();
         var17.d();
         var20.b(0L);
         return var20;
      }
   }

   private void a(MsoLineFormat var1, com.aspose.cells.a.d.zs var2) {
      switch(var1.getDashStyle()) {
      case 0:
         var2.g = 5;
         var2.a(new float[]{4.0F, 4.0F});
         break;
      case 1:
         var2.g = 5;
         var2.a(new float[]{4.0F, 3.0F, 1.0F, 3.0F});
         break;
      case 2:
         var2.g = 2;
         break;
      case 3:
         var2.g = 2;
         break;
      case 4:
         var2.g = 2;
         break;
      case 5:
         var2.g = 2;
         var2.e = 2;
         break;
      case 6:
         var2.g = 0;
         break;
      case 7:
         var2.g = 2;
      }

      switch(var1.getStyle()) {
      case 1:
         var2.m = new float[]{0.0F, 0.16666667F, 0.33333334F, 0.6666667F, 0.8333333F, 1.0F};
         break;
      case 2:
         var2.m = new float[]{0.0F, 0.2F, 0.4F, 1.0F};
         break;
      case 3:
         var2.m = new float[]{0.0F, 0.6F, 0.8F, 1.0F};
         break;
      case 4:
         var2.m = new float[]{0.0F, 0.33333334F, 0.6666667F, 1.0F};
      }

   }

   private Color a(double var1, Color var3) {
      return Color.a((int)((1.0D - var1) * 255.0D), var3);
   }

   private com.aspose.cells.b.a.b.a.zi a(Shape var1, com.aspose.cells.b.a.b.zq var2) {
      boolean var5 = false;
      int var10;
      if (var1.getRotationAngle() >= 0.0D) {
         var10 = (int)(var1.getRotationAngle() + 0.5D);
      } else {
         var10 = (int)(var1.getRotationAngle() - 0.5D);
      }

      boolean var6 = this.b(var10);
      float var3;
      float var4;
      if (var6) {
         var3 = var2.g() + var2.i() / 2.0F;
         var4 = var2.f() + var2.h() / 2.0F;
      } else {
         var3 = var2.f() + var2.h() / 2.0F;
         var4 = var2.g() + var2.i() / 2.0F;
      }

      boolean var7 = var1.N().i().e();
      boolean var8 = var1.N().i().d();
      com.aspose.cells.b.a.b.a.zi var9 = new com.aspose.cells.b.a.b.a.zi(var7 ? -1.0F : 1.0F, 0.0F, 0.0F, var8 ? -1.0F : 1.0F, var7 ? var3 * 2.0F : 0.0F, var8 ? var4 * 2.0F : 0.0F);
      var9.a(var7 ^ var8 ? (float)(-var10) : (float)var10, new com.aspose.cells.b.a.b.zo(var3, var4));
      if (var6) {
         var9.b(var2.i() / 2.0F - var2.h() / 2.0F, var2.h() / 2.0F - var2.i() / 2.0F);
      }

      return var9;
   }

   private boolean b(int var1) {
      return var1 >= 45 && var1 < 135 || var1 >= 225 && var1 < 315;
   }

   private com.aspose.cells.b.a.b.zq a(double var1, com.aspose.cells.b.a.b.zq var3) {
      com.aspose.cells.b.a.b.zq var4 = new com.aspose.cells.b.a.b.zq(var3.f(), var3.g(), var3.h(), var3.i());
      var1 %= 360.0D;
      if (var1 < 0.0D) {
         var1 += 360.0D;
      }

      float var5 = Math.abs(var3.h() - var3.i());
      if (var3.h() > var3.i()) {
         if (var1 >= 45.0D && var1 < 135.0D || var1 >= 225.0D && var1 < 315.0D) {
            var4.a(var4.f() + var5 / 2.0F);
            var4.b(var4.g() - var5 / 2.0F);
            var4.c(var3.i());
            var4.d(var3.h());
         }
      } else if (var1 >= 45.0D && var1 < 135.0D || var1 >= 225.0D && var1 < 315.0D) {
         var4.a(var4.f() - var5 / 2.0F);
         var4.b(var4.g() + var5 / 2.0F);
         var4.c(var3.i());
         var4.d(var3.h());
      }

      return var4;
   }

   private com.aspose.cells.b.a.b.zq a(com.aspose.cells.b.a.b.zo[] var1) {
      float var2 = 0.0F;
      float var3 = 0.0F;
      float var4 = 0.0F;
      float var5 = 0.0F;
      if (var1.length > 0) {
         var2 = var1[0].d();
         var3 = var1[0].d();
         var4 = var1[0].e();
         var5 = var1[0].e();
      }

      for(int var6 = 1; var6 < var1.length; ++var6) {
         com.aspose.cells.b.a.b.zo var7 = var1[var6];
         if (!com.aspose.cells.b.a.b.zo.a(var7, com.aspose.cells.b.a.b.zo.a())) {
            if (var7.d() < var2) {
               var2 = var7.d();
            }

            if (var7.d() > var3) {
               var3 = var7.d();
            }

            if (var7.e() < var4) {
               var4 = var7.e();
            }

            if (var7.e() > var5) {
               var5 = var7.e();
            }
         }
      }

      float var8 = (float)Math.ceil((double)(var3 - var2));
      if (var8 == 0.0F) {
         var8 = 1.0F;
      }

      float var9 = (float)Math.ceil((double)(var5 - var4));
      if (var9 == 0.0F) {
         var9 = 1.0F;
      }

      return new com.aspose.cells.b.a.b.zq(var2, var4, var8, var9);
   }

   private void c(zbgq var1, boolean var2) throws Exception {
      this.C.w = (float)var1.b() * (float)this.H[0];
      this.C.x = (float)var1.a() * (float)this.H[1];
      this.C.g = (float)var1.h() * (float)this.H[1];
      this.C.h = (float)var1.g() * (float)this.H[0];

      try {
         if (this.C.g * this.C.h != 0.0F) {
            com.aspose.cells.b.a.b.zq var3;
            if (this.b.getDisplayRightToLeft()) {
               var3 = new com.aspose.cells.b.a.b.zq(this.d.m.l() - (this.C.i + this.C.w - this.d.m.j()) - this.C.h + 1.0F, this.C.j + this.C.x, this.C.h, this.C.g);
            } else {
               var3 = new com.aspose.cells.b.a.b.zq(this.C.i + this.C.w, this.C.j + this.C.x, this.C.h, this.C.g);
            }

            com.aspose.cells.a.d.zb var4;
            if (var1.i() != 5) {
               com.aspose.cells.b.a.d.zh var16 = this.a(var1);
               var16.a(0L, 0);
               var4 = this.a((zbgq)var1, (com.aspose.cells.b.a.d.zm)var16, (com.aspose.cells.b.a.b.zq)var3);
               if (this.z.getDrawObjectEventHandler() != null) {
                  var16.a(0L, 0);
                  this.z.getDrawObjectEventHandler().a(var16, var3);
                  var16.a(0L, 0);
               }
            } else {
               var4 = new com.aspose.cells.a.d.zb();
               com.aspose.cells.a.d.zb var5 = new com.aspose.cells.a.d.zb();
               Chart var6 = ((ChartShape)var1.j()).a();
               float var7 = 0.0F;
               float var8 = (float)this.b.getPageSetup().getZoom() / 100.0F;
               if ((double)var8 > this.H[1] && (double)var8 < this.H[0]) {
                  var7 = var8;
               } else {
                  var7 = (float)(this.H[0] + this.H[1]) / 2.0F;
               }

               int var9 = var6.getChartObject().getWidth();
               int var10 = var6.getChartObject().getHeight();
               var6.getChartObject().setWidth((int)((double)var6.getChartObject().getWidth() * (this.H[0] / (double)var7)));
               var6.getChartObject().setHeight((int)((double)var6.getChartObject().getHeight() * (this.H[1] / (double)var7)));
               if (!(this.A instanceof com.aspose.cells.a.d.zat)) {
                  var6.d = true;
               }

               com.aspose.cells.a.d.zb var11 = var6.A();
               var6.getChartObject().setWidth(var9);
               var6.getChartObject().setHeight(var10);
               var6.d = false;
               var5.a((com.aspose.cells.a.d.zl)var11);
               var5.a(new com.aspose.cells.b.a.b.a.zi());
               var5.a().b(var3.f(), var3.g());
               var5.a().a(var7, var7);
               var4.a((com.aspose.cells.a.d.zl)var5);
               this.a(var4, var1, var3);
               if (this.z.getDrawObjectEventHandler() != null) {
                  com.aspose.cells.b.a.d.zh var12 = new com.aspose.cells.b.a.d.zh();
                  com.aspose.cells.a.d.zm var13 = new com.aspose.cells.a.d.zm((float)var1.g(), (float)var1.h());
                  var13.a(var11);
                  zam var14 = new zam();
                  var14.a(var13, var12.j());
                  var12.a(0L, 0);
                  this.z.getDrawObjectEventHandler().a(var12, var3);
               }
            }

            if (!this.C.L && !var2) {
               var4.a(new com.aspose.cells.a.d.zam(var3.f(), var3.g(), var3.h(), var3.i(), this.b.getDisplayRightToLeft()));
            } else {
               var4.a((com.aspose.cells.a.d.zam)null);
            }

            this.C.a((com.aspose.cells.a.d.zl)var4);
         }
      } catch (Exception var15) {
         com.aspose.cells.a.c.zl.b(var15);
      }

   }

   private static int b(ArrayList var0, zga var1) {
      int var2 = -1;
      Iterator var3 = var0.iterator();

      zasn var4;
      do {
         if (!var3.hasNext()) {
            return 0;
         }

         var4 = (zasn)var3.next();
         ++var2;
      } while(var4.a != var1.h().d.h().m() || var1.j() < var4.c.a || var1.j() > var4.c.c || var1.k() < var4.c.b || var1.k() > var4.c.d);

      return var2;
   }

   private void d(zga var1) {
      this.C.g = (float)var1.a(this.b, var1.j(), this.d.e, var1.l()) * (float)this.H[1];
      this.C.l = var1.b(this.b, var1.j(), this.d.e, var1.l());
      this.C.q = var1.g();
      this.C.p = var1.c().getVerticalAlignment();
      this.C.n = this.b.getPageSetup().getBlackAndWhite() || this.z != null && this.z.e;
      Style var2 = var1.c();
      if (var2 != null) {
         Color var3 = zatm.a(var2);
         if (var1.h() != null && this.s != null) {
            Iterator var4 = this.s.keySet().iterator();

            while(var4.hasNext()) {
               PdfBookmarkEntry var5 = (PdfBookmarkEntry)var4.next();
               if (var5.getDestination() != null && var5.getDestination().equals(var1.h())) {
                  int var6 = b(this.U, var1);
                  float var7 = (float)(this.d.n / 2.5399999618530273D * 72.0D);
                  float var8 = (float)(this.d.o / 2.5399999618530273D * 72.0D);
                  if (!var5.a()) {
                     var5.a(b(this.U, var1), new com.aspose.cells.b.a.b.zo(this.C.i + var7 - ((zasn)this.U.get(var6)).m.f(), (float)this.x[1] - (this.C.j + var8 - ((zasn)this.U.get(var6)).m.g())));
                  }
               }
            }
         }

         if (var1.p() != null) {
            if (this.o != null && this.o.containsKey(var1.p())) {
               Cell var10 = (Cell)((Cell)this.o.get(var1.p()));
               if (var1.h() == null) {
                  var1.a(this.Q.a(var1.j(), var1.k(), false));
               }

               this.r.put(var1.h(), var10);
               com.aspose.cells.a.d.zi var11 = new com.aspose.cells.a.d.zi(new com.aspose.cells.b.a.b.zq(this.C.i, this.C.j, this.C.h, this.C.g), "#" + var1.h().d.h().getIndex() + "_" + var1.h().getRow() + "_" + var1.h().getColumn());
               this.p.put(var1.h(), var11);
               this.C.a.a((com.aspose.cells.a.d.zl)var11);
            } else {
               int var9 = var1.p().a(this.c.getWorksheets());
               switch(var9) {
               case 0:
                  this.C.z = true;
                  this.C.A = var1.p().getAddress();
                  break;
               case 1:
                  this.C.z = true;
                  this.C.A = var1.p().getAddress();
               }
            }
         }

         this.C.m = var3;
         if (var2.getRotationAngle() != 255) {
            this.C.r = (float)var2.getRotationAngle();
         }

      }
   }

   private void a(Worksheet var1) throws Exception {
      this.C.a = new com.aspose.cells.a.d.zb();
      Chart var2 = this.b.getCharts().get(0);
      PageSetup var3 = this.b.getCharts().get(0).getPageSetup();
      this.C.y = this.b.getCells();
      this.C.e();
      this.C.i();
      float var4 = 1.0F;
      this.C.o = null;
      this.C.w = 0.0F;
      this.C.x = 0.0F;
      this.C.F = this.H;
      float var5 = (float)(var2.getChartObject().getWidthPt() * this.H[0]);
      float var6 = (float)(var2.getChartObject().getHeightPt() * this.H[1]);
      var4 = (float)Math.min(this.i / (double)var5, this.j / (double)var6);
      this.C.h = var5 * var4;
      this.C.g = var6 * var4;
      if (this.Q.i().getPrintGridlines()) {
         this.C.a(0.0F, 0.0F, this.d.m, this.Q.c);
      }

      if (this.C.g * this.C.h != 0.0F) {
         if (!(this.A instanceof com.aspose.cells.a.d.zat)) {
            var2.d = true;
         }

         com.aspose.cells.b.a.d.zh var7 = new com.aspose.cells.b.a.d.zh();
         var2.a((com.aspose.cells.b.a.d.zm)var7, (ImageFormat)this.A.e);
         var7.a(0L, 0);
         var2.d = false;
         if (var7.h() > 0L) {
            this.C.a((com.aspose.cells.b.a.d.zm)var7);
         }
      }

      this.C.a(0.0F, 0.0F);
      this.C.j();
   }

   public com.aspose.cells.a.d.zb a() throws Exception {
      this.Q = this.b.getCells();
      zasn var1 = this.d;
      if (var1.a != this.R) {
         this.R = var1.a;
         this.b = this.c.getWorksheets().get(this.R);
         this.ab = this.aa.f[this.R];
      }

      this.H = this.ad.c;
      this.t = var1.c.a;
      this.u = var1.c.c;
      this.v = var1.c.b;
      this.S = var1.c.a;
      this.g = var1.h;
      this.h = var1.i;
      this.L = this.ad.j;
      this.J = var1.l;
      float var2 = 0.0F;
      float var3 = 0.0F;
      var2 = var1.m.g();
      var3 = var1.m.f();
      if (this.b.getType() == 2) {
         try {
            this.a(this.b);
            return this.C.a;
         } catch (Exception var5) {
            ;
         }
      }

      zfu var4 = new zfu(this.t, this.v, this.u, var1.c.d);
      this.a(var4, var3, var2);
      return this.C.a;
   }

   public com.aspose.cells.a.d.zb b() throws Exception {
      this.Q = this.b.getCells();
      zasn var1 = this.d;
      this.R = var1.a;
      this.b = this.c.getWorksheets().get(this.R);
      this.H = this.ad.c;
      this.t = var1.c.a;
      this.u = var1.c.c;
      this.v = Math.min(var1.c.b, this.v);
      this.S = Math.min(var1.c.a, this.S);
      this.g = var1.h;
      this.h = var1.i;
      this.L = this.ad.j;
      this.J = var1.l;
      this.t = var1.c.a;
      this.u = var1.c.c;
      float var2 = 0.0F;
      float var3 = 0.0F;
      var2 = var1.m.g();
      var3 = var1.m.f();
      if (this.b.getType() == 2) {
         try {
            this.a(this.b);
            return this.C.a;
         } catch (Exception var5) {
            ;
         }
      }

      zfu var4 = new zfu(this.t, var1.c.b, this.u, var1.c.d);
      this.a(var4, var3, var2);
      return this.C.a;
   }

   public com.aspose.cells.a.d.zb c() throws Exception {
      String var1 = this.b.getPageSetup().getPrintArea();
      return var1 != null && var1.length() > 0 ? this.a() : this.b();
   }

   public com.aspose.cells.a.d.zb d() throws Exception {
      this.C.a = new com.aspose.cells.a.d.zb();
      this.C.d();
      this.C.c();
      this.C.e();
      this.C.i();
      this.I = new zafj(this.c, this.C, this.g, this.h, this.A, this.ad);
      this.I.a(this.b, this.e, this.f, this.d);
      this.C.f();
      this.C.g();
      this.C.j();
      return this.C.a;
   }

   public com.aspose.cells.a.d.zb a(com.aspose.cells.b.a.b.zq[] var1) throws Exception {
      float var2 = 0.0F;
      float var3 = 0.0F;
      com.aspose.cells.a.d.zb var4 = new com.aspose.cells.a.d.zb();
      this.C.a = var4;
      this.D = 0.0F;
      this.E = 0.0F;
      this.C.i = 0.0F;
      this.C.j = 0.0F;
      var1[0].c(0.0F);
      var1[0].d(0.0F);
      if (this.m >= 0 && this.n >= 0) {
         if (this.m >= this.V.b) {
            return var4;
         } else {
            int var5;
            for(var5 = this.m; var5 <= this.n; ++var5) {
               var2 += (float)(this.Q.c.b(var5) * 72.0D * this.H[0]);
            }

            for(var5 = this.V.a; var5 <= this.V.c; ++var5) {
               var3 += (float)(this.Q.getRowHeight(var5) * this.H[1]);
            }

            for(var5 = this.k; var5 <= this.l && var5 >= 0; ++var5) {
               if (var5 < this.V.a || var5 > this.V.c) {
                  var3 += (float)(this.Q.getRowHeightInch(var5) * 72.0D * this.H[1]);
               }
            }

            this.C.c = this.V.a;
            this.C.d = Math.min(this.V.b, this.m);
            this.C.e = this.V.c;
            this.C.f = Math.max(this.V.d, this.n);
            this.C.y = this.b.getCells();
            this.C.d();
            this.C.c();
            this.C.e();
            this.C.i();
            this.C.L = true;
            this.E = this.D = 0.0F;
            this.C.F = this.H;
            if (this.Q.i().getPrintGridlines()) {
               this.C.a(0.0F, 0.0F, this.d.m, this.Q.c);
            }

            int var7;
            double var8;
            for(var7 = this.k; var7 <= this.l && var7 >= 0; ++var7) {
               if (var7 < this.V.a || var7 > this.V.c) {
                  var8 = this.b.getCells().getRowHeightInch(var7);
                  this.a(var7, this.V.a, this.m, this.V.c, this.n);
                  this.C.j += (float)(var8 * 72.0D * this.H[1]);
               }
            }

            for(var7 = this.V.a; var7 <= this.V.c; ++var7) {
               var8 = this.b.getCells().getRowHeightInch(var7);
               this.a(var7, this.V.a, this.m, this.V.c, this.n);
               this.C.j += (float)(var8 * 72.0D * this.H[1]);
            }

            for(var7 = this.m; var7 <= this.n; ++var7) {
               com.aspose.cells.b.a.a.ze.a(this.A.c, (Object)var7);
            }

            var1[0].a(0.0F);
            var1[0].b(0.0F);
            var1[0].c(var2);
            var1[0].d(var3);
            zfu var9 = new zfu(this.C.c, this.C.d, this.C.e, this.C.f);
            this.a(var9, true);
            this.C.f();
            this.C.a(0.0F, 0.0F);
            this.C.g();
            this.C.j();
            this.C.L = false;
            return var4;
         }
      } else {
         return var4;
      }
   }

   public com.aspose.cells.a.d.zb b(com.aspose.cells.b.a.b.zq[] var1) throws Exception {
      float var2 = 0.0F;
      float var3 = 0.0F;
      com.aspose.cells.a.d.zb var4 = new com.aspose.cells.a.d.zb();
      this.C.a = var4;
      this.D = 0.0F;
      this.E = 0.0F;
      this.C.i = 0.0F;
      this.C.j = 0.0F;
      var1[0].c(0.0F);
      var1[0].d(0.0F);
      if (this.k >= 0 && this.l >= 0) {
         if (this.k >= this.V.a) {
            return var4;
         } else {
            int var5 = this.k;
            int var6 = this.l;
            if (this.V.a <= this.l) {
               var5 = this.k;
               var6 = this.V.a - 1;
            }

            Row var7 = this.Q.getRows().a.b(var5);
            zsm var8;
            Cell var9;
            if (var7 != null) {
               var8 = new zsm(var7, this.V.b, this.V.d);

               while(var8.hasNext()) {
                  var9 = (Cell)var8.next();
                  var9.setStyle(var9.getStyle(true));
               }
            }

            var7 = this.Q.getRows().a.b(var6);
            if (var7 != null) {
               var8 = new zsm(var7, this.V.b, this.V.d);

               while(var8.hasNext()) {
                  var9 = (Cell)var8.next();
                  var9.setStyle(var9.getStyle(true));
               }
            }

            int var12;
            for(var12 = this.V.b; var12 <= this.V.d; ++var12) {
               var2 += (float)(this.Q.c.b(var12) * 72.0D * this.H[0]);
            }

            for(var12 = this.m; var12 <= this.n && var12 >= 0; ++var12) {
               var2 += (float)(this.Q.c.b(var12) * 72.0D * this.H[0]);
            }

            for(var12 = var5; var12 <= var6 && var12 >= 0; ++var12) {
               var3 += (float)(this.b.getCells().getRowHeightInch(var12) * 72.0D * this.H[1]);
            }

            var1[0].a(0.0F);
            var1[0].b(0.0F);
            var1[0].c(var2);
            var1[0].d(var3);
            this.C.c = Math.min(this.k, this.V.a);
            this.C.d = this.V.b;
            this.C.e = Math.max(this.l, this.V.c);
            this.C.f = this.V.d;
            this.C.y = this.b.getCells();
            this.C.d();
            this.C.c();
            this.C.e();
            this.C.i();
            this.E = 0.0F;
            this.D = 0.0F;
            this.C.F = this.H;
            this.C.L = true;
            if (this.Q.i().getPrintGridlines()) {
               this.C.a(0.0F, 0.0F, this.d.m, this.Q.c);
            }

            for(var12 = var5; var12 <= var6; ++var12) {
               double var10 = this.b.getCells().getRowHeightInch(var12);
               com.aspose.cells.b.a.a.ze.a(this.A.d, (Object)var12);
               this.a(var12, this.k, this.V.b, this.l, this.V.d);
               this.C.j += (float)(var10 * 72.0D * this.H[1]);
            }

            var1[0].c(var2);
            var1[0].d(var3);
            zfu var13 = new zfu(this.C.c, this.C.d, this.C.e, this.C.f);
            this.a(var13, true);
            this.C.f();
            this.C.a(0.0F, 0.0F);
            this.C.g();
            this.C.j();
            this.C.L = false;
            return var4;
         }
      } else {
         return var4;
      }
   }

   public com.aspose.cells.a.d.zam e() {
      com.aspose.cells.a.d.zam var1 = new com.aspose.cells.a.d.zam(this.d.m, this.b.getDisplayRightToLeft());
      return var1;
   }

   private void a(com.aspose.cells.b.a.b.zj var1, com.aspose.cells.b.a.d.zm var2) throws Exception {
      com.aspose.cells.a.d.zbn.b(var1, var2);
   }

   private String a(zga var1, Font var2) {
      StringBuilder var3 = new StringBuilder();
      var3.append("Font substitution: Font [ ");
      var3.append(var2.getName());
      int var4 = var2.m();
      if ((var4 & 3) == 0) {
         var3.append("; Regular");
      } else {
         if ((var4 & 1) == 1) {
            var3.append("; Bold");
         }

         if ((var4 & 2) == 2) {
            var3.append("; Italic");
         }
      }

      var3.append(" ] has been substituted");
      Cell var5 = var1.h();
      if (var5 != null) {
         var3.append(" in Cell [ ");
         var3.append(var5.getName());
         var3.append(" ]");
      }

      var3.append(" in Sheet [ ");
      var3.append(this.b.getName());
      var3.append(" ].");
      return com.aspose.cells.b.a.zr.a(var3);
   }

   private void a(Cell var1, int var2, int var3, int var4, Cell var5) {
      boolean var6 = true;
      int var7;
      if (var1 != null) {
         var7 = Cell.a(this.Q, var2, var1.c);
         this.ac.a(var7, this.Q);
         if (var5 != null) {
            this.ac.e = var5;
         }

         var1.a(this.ac, true, this.Z);
      } else {
         var7 = Cell.a(this.Q, var2, var4);
         this.ac.a(var7, this.Q);
         Cell.a(this.b, var3, new zfv(var4), this.ac, true, this.Z);
      }

   }

   private void a(com.aspose.cells.a.d.zb var1, zbgq var2, com.aspose.cells.b.a.b.zq var3) {
      if (var2.j().getHyperlink() != null) {
         if (this.o != null && this.o.containsKey(var2.j().getHyperlink())) {
            Cell var4 = (Cell)((Cell)this.o.get(var2.j().getHyperlink()));
            this.r.put(var2, var4);
            com.aspose.cells.a.d.zi var5 = new com.aspose.cells.a.d.zi(var3, "#shape_" + var2.hashCode());
            this.p.put(var2, var5);
            this.C.a.a((com.aspose.cells.a.d.zl)var5);
         } else {
            var1.a(new com.aspose.cells.a.d.zi(var3, com.aspose.cells.b.a.zv.a(var2.j().getHyperlink().getAddress(), "\\", "/")));
         }
      }

   }
}
